﻿
@model IEnumerable<Developer.Entity.CycleProblem>

@{
    ViewBag.Title = "Index";
    Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml";
    var i = 1;
}
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 维修管理 <span class="c-gray en">&gt;</span> 手机故障列表 <a class="btn btn-success radius r" id="btn-refresh" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
    <div class="text-c">
        <form id="searchForm" action="/admin/Cycle/problem" method="get">
            <input type="text" class="input-text" style="width: 250px" placeholder="输入颜色名称" id="companyname" name="name" value="@ViewBag.Name">
            <button type="submit" class="btn btn-success radius"><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
        </form>

    </div>
    <div class="cl pd-5 bg-1 bk-gray mt-20"> <span class="l"><a href="javascript:;" onclick="sf_batdel('/admin/Cycle/batdelete')" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a> <a href="javascript:;" onclick="sf_show('新增分类', '/admin/Cycle/Editproblem', '', '420',true)" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe600;</i> 新增分类</a> </span> 
    
        <label>筛选：</label>
        <select name="" id="s2id_managerid" style="height: 29px;" onchange="window.location=this.value;" >
            @{
                int mid = (int)ViewBag.mid;
                var models = Developer.Service.CycleModelService.GetAll().Where(a => a.IsAbort == false).OrderBy(a => a.Name);
                if (mid > 0)
                {
                    <option value="/admin/Cycle/Problem?mid=@(mid)">@(models.FirstOrDefault(a => a.Id == mid).Name)</option>

                }
                else
                {
                    <option value="/admin/Cycle/Problem">选择型号</option>
                }
                foreach (var brand in models)
                {
                    <option value="/admin/Cycle/Problem?mid=@(brand.Id)">@(brand.Name)</option>
                }

            }
        </select>
    <span class="r">共有数据：<strong>@ViewBag.itemCount</strong> 条</span> </div>
    <div class="mt-20">
        <table class="table table-border table-bordered table-hover table-bg table-sort">
            <thead>
                <tr class="text-c">
                    <th><input type="checkbox" name="" value=""></th>
                    <th>序号</th>
                    <th>名称</th>
                    <th>创建时间</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                @foreach (var item in Model.OrderBy(a=>a.CycleModel.Name))
            {
                    <tr class="text-c">
                        <td><input type="checkbox" value="@item.Id" name="checkedList"></td>
                        <td id="companyId">@(i++)</td>
                        <td>@(item.CycleModel.CycleBrand.CycleType.Name
                        +">"+item.CycleModel.CycleBrand.CycleType.Name
                        +">"+item.CycleModel.CycleBrand.Name
                        +">"+item.CycleModel.Name
                        +">"+item.Name)</td>
                        <td>@item.CreateTime</td>
                        <td class="td-manage">
                            <a title="编辑" href="javascript:;" onclick="sf_show('编辑', '/admin/Cycle/Editproblem/?typeId=@item.Id', '', '420', true)" class="ml-5 btn btn-primary radius" style="text-decoration: none">编辑</a>

                            <a title="删除" href="javascript:;" onclick="sf_del('/admin/Cycle/Deleteproblem?typeId=@(item.Id)')" class="ml-5 btn btn-primary radius" style="text-decoration: none">删除</a>
                        </td>
                    </tr>
                }
            </tbody>
        </table>
        <div id="adminPage"></div>
        <div style="clear:both;"></div>
    </div>
</div>
<style>
    .select2-dropdown {
        background-color: #d2f3f0;
    }

    .select2-container .select2-choice {
        margin-left: -15px;
    }
</style>
<script type="text/javascript">
    sf_page('adminPage', @ViewBag.pageCount);

    $("#s2id_managerid").select2({
        placeholder: '请选择型号'
    });
</script>

